import { useState } from "react"
import './head.scss'
export default function Headers() {

    const [data, setData] = useState({
        urls: [
            {
                label: '首页',
                path: '/'
            },
            {
                label: '文章',
                path: '/'
            }
        ]
    })
    let urlDom = data.urls.map((res, i) => {
        return (<div onClick={() => listClickEvent(res)} className="hList" path={res.path} key={'hl' + i}>
            <div>{res.label}</div>
        </div>)
    })

    function listClickEvent(res) {
        console.log(res);
    }
    return (
        <div className="head">
            <div className="headMain">
                {urlDom}
            </div>
        </div>
    )
}

